package controlSoftware.GUI;

import java.io.File;

import javax.swing.filechooser.FileFilter;

import controlSoftware.util.Common;

/**
 * XML Filter used by playback
 * @author Jiaxi
 *
 */
public class XMLFilter extends FileFilter {
 
    //Accept all directories and all xml files.
    public boolean accept(File f) {
        if (f.isDirectory()) {
            return true;
        }
 
        String extension = Common.getExtension(f);
        if (extension != null) {
            if (extension.equals(Common.xml))
            {
                return true;
            } else {
                return false;
            }
        }
 
        return false;
    }
 
    //The description of this filter
    public String getDescription() {
        return "XML Filter";
    }
}